package com.jming.jike.dto.backend;

import com.jming.jike.common.ValidatorGroup.Update;
import com.jming.jike.dto.BaseDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author jinming.zhang
 * @version 0.0.1
 * @date 2022/04/29
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrdersDTO extends BaseDTO {

    @ApiModelProperty("订单id")
    @NotNull(message = "订单id不能为空", groups = {Update.class})
    @Min(value = 1, message = "订单id不能小于{value}", groups = {Update.class})
    private Long id;

    @ApiModelProperty("订单号 支持模糊查询")
    private String orderId;

    @ApiModelProperty("订单状态 1待付款，2待派送，3已派送，4已完成，5已取消 不传查全部")
    private Integer status;

    @ApiModelProperty("支付方式 1微信, 2支付宝 不传查全部")
    private Integer payMethod;

    @ApiModelProperty("下单时间: 始")
    private Date startTime;

    @ApiModelProperty("结束时间: 止")
    private Date endTime;

    @ApiModelProperty("操作描述 1 取消，2 派送，3 完成 操作订单时传 其余可不传")
    @NotNull(message = "操作描述不能为空", groups = {Update.class})
    @Range(min = 1, max = 3, message = "操作不正确({min}~{max})", groups = {Update.class})
    private Integer operDesc;

}
